//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension CloudWatchEvents {
    // MARK: Enums

    public enum ArchiveState: String, CustomStringConvertible, Codable {
        case createFailed = "CREATE_FAILED"
        case creating = "CREATING"
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        case updateFailed = "UPDATE_FAILED"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum AssignPublicIp: String, CustomStringConvertible, Codable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    public enum EventSourceState: String, CustomStringConvertible, Codable {
        case active = "ACTIVE"
        case deleted = "DELETED"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum LaunchType: String, CustomStringConvertible, Codable {
        case ec2 = "EC2"
        case fargate = "FARGATE"
        public var description: String { return self.rawValue }
    }

    public enum ReplayState: String, CustomStringConvertible, Codable {
        case cancelled = "CANCELLED"
        case cancelling = "CANCELLING"
        case completed = "COMPLETED"
        case failed = "FAILED"
        case running = "RUNNING"
        case starting = "STARTING"
        public var description: String { return self.rawValue }
    }

    public enum RuleState: String, CustomStringConvertible, Codable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct ActivateEventSourceRequest: AWSEncodableShape {
        /// The name of the partner event source to activate.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct Archive: AWSDecodableShape {
        /// The name of the archive.
        public let archiveName: String?
        /// The time stamp for the time that the archive was created.
        public let creationTime: Date?
        /// The number of events in the archive.
        public let eventCount: Int64?
        /// The ARN of the event bus associated with the archive. Only events from this event bus are sent to the archive.
        public let eventSourceArn: String?
        /// The number of days to retain events in the archive before they are deleted.
        public let retentionDays: Int?
        /// The size of the archive, in bytes.
        public let sizeBytes: Int64?
        /// The current state of the archive.
        public let state: ArchiveState?
        /// A description for the reason that the archive is in the current state.
        public let stateReason: String?

        public init(archiveName: String? = nil, creationTime: Date? = nil, eventCount: Int64? = nil, eventSourceArn: String? = nil, retentionDays: Int? = nil, sizeBytes: Int64? = nil, state: ArchiveState? = nil, stateReason: String? = nil) {
            self.archiveName = archiveName
            self.creationTime = creationTime
            self.eventCount = eventCount
            self.eventSourceArn = eventSourceArn
            self.retentionDays = retentionDays
            self.sizeBytes = sizeBytes
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case archiveName = "ArchiveName"
            case creationTime = "CreationTime"
            case eventCount = "EventCount"
            case eventSourceArn = "EventSourceArn"
            case retentionDays = "RetentionDays"
            case sizeBytes = "SizeBytes"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct AwsVpcConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Specifies whether the task's elastic network interface receives a public IP address. You can specify ENABLED only when LaunchType in EcsParameters is set to FARGATE.
        public let assignPublicIp: AssignPublicIp?
        /// Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.
        public let securityGroups: [String]?
        /// Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.
        public let subnets: [String]

        public init(assignPublicIp: AssignPublicIp? = nil, securityGroups: [String]? = nil, subnets: [String]) {
            self.assignPublicIp = assignPublicIp
            self.securityGroups = securityGroups
            self.subnets = subnets
        }

        private enum CodingKeys: String, CodingKey {
            case assignPublicIp = "AssignPublicIp"
            case securityGroups = "SecurityGroups"
            case subnets = "Subnets"
        }
    }

    public struct BatchArrayProperties: AWSEncodableShape & AWSDecodableShape {
        /// The size of the array, if this is an array batch job. Valid values are integers between 2 and 10,000.
        public let size: Int?

        public init(size: Int? = nil) {
            self.size = size
        }

        private enum CodingKeys: String, CodingKey {
            case size = "Size"
        }
    }

    public struct BatchParameters: AWSEncodableShape & AWSDecodableShape {
        /// The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. This parameter is used only if the target is an AWS Batch job.
        public let arrayProperties: BatchArrayProperties?
        /// The ARN or name of the job definition to use if the event target is an AWS Batch job. This job definition must already exist.
        public let jobDefinition: String
        /// The name to use for this execution of the job, if the target is an AWS Batch job.
        public let jobName: String
        /// The retry strategy to use for failed jobs, if the target is an AWS Batch job. The retry strategy is the number of times to retry the failed job execution. Valid values are 1–10. When you specify a retry strategy here, it overrides the retry strategy defined in the job definition.
        public let retryStrategy: BatchRetryStrategy?

        public init(arrayProperties: BatchArrayProperties? = nil, jobDefinition: String, jobName: String, retryStrategy: BatchRetryStrategy? = nil) {
            self.arrayProperties = arrayProperties
            self.jobDefinition = jobDefinition
            self.jobName = jobName
            self.retryStrategy = retryStrategy
        }

        private enum CodingKeys: String, CodingKey {
            case arrayProperties = "ArrayProperties"
            case jobDefinition = "JobDefinition"
            case jobName = "JobName"
            case retryStrategy = "RetryStrategy"
        }
    }

    public struct BatchRetryStrategy: AWSEncodableShape & AWSDecodableShape {
        /// The number of times to attempt to retry, if the job fails. Valid values are 1–10.
        public let attempts: Int?

        public init(attempts: Int? = nil) {
            self.attempts = attempts
        }

        private enum CodingKeys: String, CodingKey {
            case attempts = "Attempts"
        }
    }

    public struct CancelReplayRequest: AWSEncodableShape {
        /// The name of the replay to cancel.
        public let replayName: String

        public init(replayName: String) {
            self.replayName = replayName
        }

        public func validate(name: String) throws {
            try self.validate(self.replayName, name: "replayName", parent: name, max: 64)
            try self.validate(self.replayName, name: "replayName", parent: name, min: 1)
            try self.validate(self.replayName, name: "replayName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case replayName = "ReplayName"
        }
    }

    public struct CancelReplayResponse: AWSDecodableShape {
        /// The ARN of the replay to cancel.
        public let replayArn: String?
        /// The current state of the replay.
        public let state: ReplayState?
        /// The reason that the replay is in the current state.
        public let stateReason: String?

        public init(replayArn: String? = nil, state: ReplayState? = nil, stateReason: String? = nil) {
            self.replayArn = replayArn
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case replayArn = "ReplayArn"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct Condition: AWSEncodableShape {
        /// Specifies the key for the condition. Currently the only supported key is aws:PrincipalOrgID.
        public let key: String
        /// Specifies the type of condition. Currently the only supported value is StringEquals.
        public let type: String
        /// Specifies the value for the key. Currently, this must be the ID of the organization.
        public let value: String

        public init(key: String, type: String, value: String) {
            self.key = key
            self.type = type
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case type = "Type"
            case value = "Value"
        }
    }

    public struct CreateArchiveRequest: AWSEncodableShape {
        /// The name for the archive to create.
        public let archiveName: String
        /// A description for the archive.
        public let description: String?
        /// An event pattern to use to filter events sent to the archive.
        public let eventPattern: String?
        /// The ARN of the event source associated with the archive.
        public let eventSourceArn: String
        /// The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely
        public let retentionDays: Int?

        public init(archiveName: String, description: String? = nil, eventPattern: String? = nil, eventSourceArn: String, retentionDays: Int? = nil) {
            self.archiveName = archiveName
            self.description = description
            self.eventPattern = eventPattern
            self.eventSourceArn = eventSourceArn
            self.retentionDays = retentionDays
        }

        public func validate(name: String) throws {
            try self.validate(self.archiveName, name: "archiveName", parent: name, max: 48)
            try self.validate(self.archiveName, name: "archiveName", parent: name, min: 1)
            try self.validate(self.archiveName, name: "archiveName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.description, name: "description", parent: name, max: 512)
            try self.validate(self.description, name: "description", parent: name, pattern: ".*")
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, max: 1600)
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, min: 1)
            try self.validate(self.retentionDays, name: "retentionDays", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case archiveName = "ArchiveName"
            case description = "Description"
            case eventPattern = "EventPattern"
            case eventSourceArn = "EventSourceArn"
            case retentionDays = "RetentionDays"
        }
    }

    public struct CreateArchiveResponse: AWSDecodableShape {
        /// The ARN of the archive that was created.
        public let archiveArn: String?
        /// The time at which the archive was created.
        public let creationTime: Date?
        /// The state of the archive that was created.
        public let state: ArchiveState?
        /// The reason that the archive is in the state.
        public let stateReason: String?

        public init(archiveArn: String? = nil, creationTime: Date? = nil, state: ArchiveState? = nil, stateReason: String? = nil) {
            self.archiveArn = archiveArn
            self.creationTime = creationTime
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case archiveArn = "ArchiveArn"
            case creationTime = "CreationTime"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct CreateEventBusRequest: AWSEncodableShape {
        /// If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.
        public let eventSourceName: String?
        /// The name of the new event bus.  Event bus names cannot contain the / character. You can't use the name default for a custom event bus, as this name is already used for your account's default event bus. If this is a partner event bus, the name must exactly match the name of the partner event source that this event bus is matched to.
        public let name: String
        /// Tags to associate with the event bus.
        public let tags: [Tag]?

        public init(eventSourceName: String? = nil, name: String, tags: [Tag]? = nil) {
            self.eventSourceName = eventSourceName
            self.name = name
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.eventSourceName, name: "eventSourceName", parent: name, max: 256)
            try self.validate(self.eventSourceName, name: "eventSourceName", parent: name, min: 1)
            try self.validate(self.eventSourceName, name: "eventSourceName", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[/\\.\\-_A-Za-z0-9]+")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case eventSourceName = "EventSourceName"
            case name = "Name"
            case tags = "Tags"
        }
    }

    public struct CreateEventBusResponse: AWSDecodableShape {
        /// The ARN of the new event bus.
        public let eventBusArn: String?

        public init(eventBusArn: String? = nil) {
            self.eventBusArn = eventBusArn
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusArn = "EventBusArn"
        }
    }

    public struct CreatePartnerEventSourceRequest: AWSEncodableShape {
        /// The AWS account ID that is permitted to create a matching partner event bus for this partner event source.
        public let account: String
        /// The name of the partner event source. This name must be unique and must be in the format  partner_name/event_namespace/event_name . The AWS account that wants to use this partner event source must create a partner event bus with a name that matches the name of the partner event source.
        public let name: String

        public init(account: String, name: String) {
            self.account = account
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.account, name: "account", parent: name, max: 12)
            try self.validate(self.account, name: "account", parent: name, min: 12)
            try self.validate(self.account, name: "account", parent: name, pattern: "\\d{12}")
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
        }

        private enum CodingKeys: String, CodingKey {
            case account = "Account"
            case name = "Name"
        }
    }

    public struct CreatePartnerEventSourceResponse: AWSDecodableShape {
        /// The ARN of the partner event source.
        public let eventSourceArn: String?

        public init(eventSourceArn: String? = nil) {
            self.eventSourceArn = eventSourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case eventSourceArn = "EventSourceArn"
        }
    }

    public struct DeactivateEventSourceRequest: AWSEncodableShape {
        /// The name of the partner event source to deactivate.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeadLetterConfig: AWSEncodableShape & AWSDecodableShape {
        /// The ARN of the SQS queue specified as the target for the dead-letter queue.
        public let arn: String?

        public init(arn: String? = nil) {
            self.arn = arn
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 1600)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
        }
    }

    public struct DeleteArchiveRequest: AWSEncodableShape {
        /// The name of the archive to delete.
        public let archiveName: String

        public init(archiveName: String) {
            self.archiveName = archiveName
        }

        public func validate(name: String) throws {
            try self.validate(self.archiveName, name: "archiveName", parent: name, max: 48)
            try self.validate(self.archiveName, name: "archiveName", parent: name, min: 1)
            try self.validate(self.archiveName, name: "archiveName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case archiveName = "ArchiveName"
        }
    }

    public struct DeleteArchiveResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteEventBusRequest: AWSEncodableShape {
        /// The name of the event bus to delete.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[/\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeletePartnerEventSourceRequest: AWSEncodableShape {
        /// The AWS account ID of the AWS customer that the event source was created for.
        public let account: String
        /// The name of the event source to delete.
        public let name: String

        public init(account: String, name: String) {
            self.account = account
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.account, name: "account", parent: name, max: 12)
            try self.validate(self.account, name: "account", parent: name, min: 12)
            try self.validate(self.account, name: "account", parent: name, pattern: "\\d{12}")
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
        }

        private enum CodingKeys: String, CodingKey {
            case account = "Account"
            case name = "Name"
        }
    }

    public struct DeleteRuleRequest: AWSEncodableShape {
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// If this is a managed rule, created by an AWS service on your behalf, you must specify Force as True to delete the rule. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using DescribeRule or ListRules and checking the ManagedBy field of the response.
        public let force: Bool?
        /// The name of the rule.
        public let name: String

        public init(eventBusName: String? = nil, force: Bool? = nil, name: String) {
            self.eventBusName = eventBusName
            self.force = force
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case force = "Force"
            case name = "Name"
        }
    }

    public struct DescribeArchiveRequest: AWSEncodableShape {
        /// The name of the archive to retrieve.
        public let archiveName: String

        public init(archiveName: String) {
            self.archiveName = archiveName
        }

        public func validate(name: String) throws {
            try self.validate(self.archiveName, name: "archiveName", parent: name, max: 48)
            try self.validate(self.archiveName, name: "archiveName", parent: name, min: 1)
            try self.validate(self.archiveName, name: "archiveName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case archiveName = "ArchiveName"
        }
    }

    public struct DescribeArchiveResponse: AWSDecodableShape {
        /// The ARN of the archive.
        public let archiveArn: String?
        /// The name of the archive.
        public let archiveName: String?
        /// The time at which the archive was created.
        public let creationTime: Date?
        /// The description of the archive.
        public let description: String?
        /// The number of events in the archive.
        public let eventCount: Int64?
        /// The event pattern used to filter events sent to the archive.
        public let eventPattern: String?
        /// The ARN of the event source associated with the archive.
        public let eventSourceArn: String?
        /// The number of days to retain events for in the archive.
        public let retentionDays: Int?
        /// The size of the archive in bytes.
        public let sizeBytes: Int64?
        /// The state of the archive.
        public let state: ArchiveState?
        /// The reason that the archive is in the state.
        public let stateReason: String?

        public init(archiveArn: String? = nil, archiveName: String? = nil, creationTime: Date? = nil, description: String? = nil, eventCount: Int64? = nil, eventPattern: String? = nil, eventSourceArn: String? = nil, retentionDays: Int? = nil, sizeBytes: Int64? = nil, state: ArchiveState? = nil, stateReason: String? = nil) {
            self.archiveArn = archiveArn
            self.archiveName = archiveName
            self.creationTime = creationTime
            self.description = description
            self.eventCount = eventCount
            self.eventPattern = eventPattern
            self.eventSourceArn = eventSourceArn
            self.retentionDays = retentionDays
            self.sizeBytes = sizeBytes
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case archiveArn = "ArchiveArn"
            case archiveName = "ArchiveName"
            case creationTime = "CreationTime"
            case description = "Description"
            case eventCount = "EventCount"
            case eventPattern = "EventPattern"
            case eventSourceArn = "EventSourceArn"
            case retentionDays = "RetentionDays"
            case sizeBytes = "SizeBytes"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct DescribeEventBusRequest: AWSEncodableShape {
        /// The name or ARN of the event bus to show details for. If you omit this, the default event bus is displayed.
        public let name: String?

        public init(name: String? = nil) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 1600)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DescribeEventBusResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the account permitted to write events to the current account.
        public let arn: String?
        /// The name of the event bus. Currently, this is always default.
        public let name: String?
        /// The policy that enables the external account to send events to your account.
        public let policy: String?

        public init(arn: String? = nil, name: String? = nil, policy: String? = nil) {
            self.arn = arn
            self.name = name
            self.policy = policy
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case name = "Name"
            case policy = "Policy"
        }
    }

    public struct DescribeEventSourceRequest: AWSEncodableShape {
        /// The name of the partner event source to display the details of.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DescribeEventSourceResponse: AWSDecodableShape {
        /// The ARN of the partner event source.
        public let arn: String?
        /// The name of the SaaS partner that created the event source.
        public let createdBy: String?
        /// The date and time that the event source was created.
        public let creationTime: Date?
        /// The date and time that the event source will expire if you do not create a matching event bus.
        public let expirationTime: Date?
        /// The name of the partner event source.
        public let name: String?
        /// The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has since been deleted.
        public let state: EventSourceState?

        public init(arn: String? = nil, createdBy: String? = nil, creationTime: Date? = nil, expirationTime: Date? = nil, name: String? = nil, state: EventSourceState? = nil) {
            self.arn = arn
            self.createdBy = createdBy
            self.creationTime = creationTime
            self.expirationTime = expirationTime
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case createdBy = "CreatedBy"
            case creationTime = "CreationTime"
            case expirationTime = "ExpirationTime"
            case name = "Name"
            case state = "State"
        }
    }

    public struct DescribePartnerEventSourceRequest: AWSEncodableShape {
        /// The name of the event source to display.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DescribePartnerEventSourceResponse: AWSDecodableShape {
        /// The ARN of the event source.
        public let arn: String?
        /// The name of the event source.
        public let name: String?

        public init(arn: String? = nil, name: String? = nil) {
            self.arn = arn
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case name = "Name"
        }
    }

    public struct DescribeReplayRequest: AWSEncodableShape {
        /// The name of the replay to retrieve.
        public let replayName: String

        public init(replayName: String) {
            self.replayName = replayName
        }

        public func validate(name: String) throws {
            try self.validate(self.replayName, name: "replayName", parent: name, max: 64)
            try self.validate(self.replayName, name: "replayName", parent: name, min: 1)
            try self.validate(self.replayName, name: "replayName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case replayName = "ReplayName"
        }
    }

    public struct DescribeReplayResponse: AWSDecodableShape {
        /// The description of the replay.
        public let description: String?
        /// A ReplayDestination object that contains details about the replay.
        public let destination: ReplayDestination?
        /// The time stamp for the last event that was replayed from the archive.
        public let eventEndTime: Date?
        /// The time that the event was last replayed.
        public let eventLastReplayedTime: Date?
        /// The ARN of the archive events were replayed from.
        public let eventSourceArn: String?
        /// The time stamp of the first event that was last replayed from the archive.
        public let eventStartTime: Date?
        /// The ARN of the replay.
        public let replayArn: String?
        /// A time stamp for the time that the replay stopped.
        public let replayEndTime: Date?
        /// The name of the replay.
        public let replayName: String?
        /// A time stamp for the time that the replay started.
        public let replayStartTime: Date?
        /// The current state of the replay.
        public let state: ReplayState?
        /// The reason that the replay is in the current state.
        public let stateReason: String?

        public init(description: String? = nil, destination: ReplayDestination? = nil, eventEndTime: Date? = nil, eventLastReplayedTime: Date? = nil, eventSourceArn: String? = nil, eventStartTime: Date? = nil, replayArn: String? = nil, replayEndTime: Date? = nil, replayName: String? = nil, replayStartTime: Date? = nil, state: ReplayState? = nil, stateReason: String? = nil) {
            self.description = description
            self.destination = destination
            self.eventEndTime = eventEndTime
            self.eventLastReplayedTime = eventLastReplayedTime
            self.eventSourceArn = eventSourceArn
            self.eventStartTime = eventStartTime
            self.replayArn = replayArn
            self.replayEndTime = replayEndTime
            self.replayName = replayName
            self.replayStartTime = replayStartTime
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case destination = "Destination"
            case eventEndTime = "EventEndTime"
            case eventLastReplayedTime = "EventLastReplayedTime"
            case eventSourceArn = "EventSourceArn"
            case eventStartTime = "EventStartTime"
            case replayArn = "ReplayArn"
            case replayEndTime = "ReplayEndTime"
            case replayName = "ReplayName"
            case replayStartTime = "ReplayStartTime"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct DescribeRuleRequest: AWSEncodableShape {
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The name of the rule.
        public let name: String

        public init(eventBusName: String? = nil, name: String) {
            self.eventBusName = eventBusName
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case name = "Name"
        }
    }

    public struct DescribeRuleResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the rule.
        public let arn: String?
        /// The account ID of the user that created the rule. If you use PutRule to put a rule on an event bus in another account, the other account is the owner of the rule, and the rule ARN includes the account ID for that account. However, the value for CreatedBy is the account ID as the account that created the rule in the other account.
        public let createdBy: String?
        /// The description of the rule.
        public let description: String?
        /// The name of the event bus associated with the rule.
        public let eventBusName: String?
        /// The event pattern. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
        public let eventPattern: String?
        /// If this is a managed rule, created by an AWS service on your behalf, this field displays the principal name of the AWS service that created the rule.
        public let managedBy: String?
        /// The name of the rule.
        public let name: String?
        /// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
        public let roleArn: String?
        /// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
        public let scheduleExpression: String?
        /// Specifies whether the rule is enabled or disabled.
        public let state: RuleState?

        public init(arn: String? = nil, createdBy: String? = nil, description: String? = nil, eventBusName: String? = nil, eventPattern: String? = nil, managedBy: String? = nil, name: String? = nil, roleArn: String? = nil, scheduleExpression: String? = nil, state: RuleState? = nil) {
            self.arn = arn
            self.createdBy = createdBy
            self.description = description
            self.eventBusName = eventBusName
            self.eventPattern = eventPattern
            self.managedBy = managedBy
            self.name = name
            self.roleArn = roleArn
            self.scheduleExpression = scheduleExpression
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case createdBy = "CreatedBy"
            case description = "Description"
            case eventBusName = "EventBusName"
            case eventPattern = "EventPattern"
            case managedBy = "ManagedBy"
            case name = "Name"
            case roleArn = "RoleArn"
            case scheduleExpression = "ScheduleExpression"
            case state = "State"
        }
    }

    public struct DisableRuleRequest: AWSEncodableShape {
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The name of the rule.
        public let name: String

        public init(eventBusName: String? = nil, name: String) {
            self.eventBusName = eventBusName
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case name = "Name"
        }
    }

    public struct EcsParameters: AWSEncodableShape & AWSDecodableShape {
        /// Specifies an ECS task group for the task. The maximum length is 255 characters.
        public let group: String?
        /// Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The FARGATE value is supported only in the Regions where AWS Fargate with Amazon ECS is supported. For more information, see AWS Fargate on Amazon ECS in the Amazon Elastic Container Service Developer Guide.
        public let launchType: LaunchType?
        /// Use this structure if the ECS task uses the awsvpc network mode. This structure specifies the VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This structure is required if LaunchType is FARGATE because the awsvpc mode is required for Fargate tasks. If you specify NetworkConfiguration when the target ECS task does not use the awsvpc network mode, the task fails.
        public let networkConfiguration: NetworkConfiguration?
        /// Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. This structure is used only if LaunchType is FARGATE. For more information about valid platform versions, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
        public let platformVersion: String?
        /// The number of tasks to create based on TaskDefinition. The default is 1.
        public let taskCount: Int?
        /// The ARN of the task definition to use if the event target is an Amazon ECS task.
        public let taskDefinitionArn: String

        public init(group: String? = nil, launchType: LaunchType? = nil, networkConfiguration: NetworkConfiguration? = nil, platformVersion: String? = nil, taskCount: Int? = nil, taskDefinitionArn: String) {
            self.group = group
            self.launchType = launchType
            self.networkConfiguration = networkConfiguration
            self.platformVersion = platformVersion
            self.taskCount = taskCount
            self.taskDefinitionArn = taskDefinitionArn
        }

        public func validate(name: String) throws {
            try self.validate(self.taskCount, name: "taskCount", parent: name, min: 1)
            try self.validate(self.taskDefinitionArn, name: "taskDefinitionArn", parent: name, max: 1600)
            try self.validate(self.taskDefinitionArn, name: "taskDefinitionArn", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case group = "Group"
            case launchType = "LaunchType"
            case networkConfiguration = "NetworkConfiguration"
            case platformVersion = "PlatformVersion"
            case taskCount = "TaskCount"
            case taskDefinitionArn = "TaskDefinitionArn"
        }
    }

    public struct EnableRuleRequest: AWSEncodableShape {
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The name of the rule.
        public let name: String

        public init(eventBusName: String? = nil, name: String) {
            self.eventBusName = eventBusName
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case name = "Name"
        }
    }

    public struct EventBus: AWSDecodableShape {
        /// The ARN of the event bus.
        public let arn: String?
        /// The name of the event bus.
        public let name: String?
        /// The permissions policy of the event bus, describing which other AWS accounts can write events to this event bus.
        public let policy: String?

        public init(arn: String? = nil, name: String? = nil, policy: String? = nil) {
            self.arn = arn
            self.name = name
            self.policy = policy
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case name = "Name"
            case policy = "Policy"
        }
    }

    public struct EventSource: AWSDecodableShape {
        /// The ARN of the event source.
        public let arn: String?
        /// The name of the partner that created the event source.
        public let createdBy: String?
        /// The date and time the event source was created.
        public let creationTime: Date?
        /// The date and time that the event source will expire, if the AWS account doesn't create a matching event bus for it.
        public let expirationTime: Date?
        /// The name of the event source.
        public let name: String?
        /// The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has since been deleted.
        public let state: EventSourceState?

        public init(arn: String? = nil, createdBy: String? = nil, creationTime: Date? = nil, expirationTime: Date? = nil, name: String? = nil, state: EventSourceState? = nil) {
            self.arn = arn
            self.createdBy = createdBy
            self.creationTime = creationTime
            self.expirationTime = expirationTime
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case createdBy = "CreatedBy"
            case creationTime = "CreationTime"
            case expirationTime = "ExpirationTime"
            case name = "Name"
            case state = "State"
        }
    }

    public struct HttpParameters: AWSEncodableShape & AWSDecodableShape {
        /// The headers that need to be sent as part of request invoking the API Gateway REST API.
        public let headerParameters: [String: String]?
        /// The path parameter values to be used to populate API Gateway REST API path wildcards ("*").
        public let pathParameterValues: [String]?
        /// The query string keys/values that need to be sent as part of request invoking the API Gateway REST API.
        public let queryStringParameters: [String: String]?

        public init(headerParameters: [String: String]? = nil, pathParameterValues: [String]? = nil, queryStringParameters: [String: String]? = nil) {
            self.headerParameters = headerParameters
            self.pathParameterValues = pathParameterValues
            self.queryStringParameters = queryStringParameters
        }

        public func validate(name: String) throws {
            try self.headerParameters?.forEach {
                try validate($0.key, name: "headerParameters.key", parent: name, max: 512)
                try validate($0.key, name: "headerParameters.key", parent: name, pattern: "^[!#$%&'*+-.^_`|~0-9a-zA-Z]+$")
                try validate($0.value, name: "headerParameters[\"\($0.key)\"]", parent: name, max: 512)
                try validate($0.value, name: "headerParameters[\"\($0.key)\"]", parent: name, pattern: "^[ \\t]*[\\x20-\\x7E]+([ \\t]+[\\x20-\\x7E]+)*[ \\t]*$")
            }
            try self.pathParameterValues?.forEach {
                try validate($0, name: "pathParameterValues[]", parent: name, pattern: "^(?!\\s*$).+")
            }
            try self.queryStringParameters?.forEach {
                try validate($0.key, name: "queryStringParameters.key", parent: name, max: 512)
                try validate($0.key, name: "queryStringParameters.key", parent: name, pattern: "[^\\x00-\\x1F\\x7F]+")
                try validate($0.value, name: "queryStringParameters[\"\($0.key)\"]", parent: name, max: 512)
                try validate($0.value, name: "queryStringParameters[\"\($0.key)\"]", parent: name, pattern: "[^\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F]+")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case headerParameters = "HeaderParameters"
            case pathParameterValues = "PathParameterValues"
            case queryStringParameters = "QueryStringParameters"
        }
    }

    public struct InputTransformer: AWSEncodableShape & AWSDecodableShape {
        /// Map of JSON paths to be extracted from the event. You can then insert these in the template in InputTemplate to produce the output you want to be sent to the target.  InputPathsMap is an array key-value pairs, where each value is a valid JSON path. You can have as many as 10 key-value pairs. You must use JSON dot notation, not bracket notation. The keys cannot start with "AWS."
        public let inputPathsMap: [String: String]?
        /// Input template where you specify placeholders that will be filled with the values of the keys from InputPathsMap to customize the data sent to the target. Enclose each InputPathsMaps value in brackets: &lt;value&gt; The InputTemplate must be valid JSON. If InputTemplate is a JSON object (surrounded by curly braces), the following restrictions apply:   The placeholder cannot be used as an object key.   Object values cannot include quote marks.   The following example shows the syntax for using InputPathsMap and InputTemplate.   "InputTransformer":   {   "InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},   "InputTemplate": "&lt;instance&gt; is in state &lt;status&gt;"   }  To have the InputTemplate include quote marks within a JSON string, escape each quote marks with a slash, as in the following example:   "InputTransformer":   {   "InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},   "InputTemplate": "&lt;instance&gt; is in state \"&lt;status&gt;\""   }
        public let inputTemplate: String

        public init(inputPathsMap: [String: String]? = nil, inputTemplate: String) {
            self.inputPathsMap = inputPathsMap
            self.inputTemplate = inputTemplate
        }

        public func validate(name: String) throws {
            try self.inputPathsMap?.forEach {
                try validate($0.key, name: "inputPathsMap.key", parent: name, max: 256)
                try validate($0.key, name: "inputPathsMap.key", parent: name, min: 1)
                try validate($0.key, name: "inputPathsMap.key", parent: name, pattern: "[A-Za-z0-9\\_\\-]+")
                try validate($0.value, name: "inputPathsMap[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.inputTemplate, name: "inputTemplate", parent: name, max: 8192)
            try self.validate(self.inputTemplate, name: "inputTemplate", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case inputPathsMap = "InputPathsMap"
            case inputTemplate = "InputTemplate"
        }
    }

    public struct KinesisParameters: AWSEncodableShape & AWSDecodableShape {
        /// The JSON path to be extracted from the event and used as the partition key. For more information, see Amazon Kinesis Streams Key Concepts in the Amazon Kinesis Streams Developer Guide.
        public let partitionKeyPath: String

        public init(partitionKeyPath: String) {
            self.partitionKeyPath = partitionKeyPath
        }

        public func validate(name: String) throws {
            try self.validate(self.partitionKeyPath, name: "partitionKeyPath", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case partitionKeyPath = "PartitionKeyPath"
        }
    }

    public struct ListArchivesRequest: AWSEncodableShape {
        /// The ARN of the event source associated with the archive.
        public let eventSourceArn: String?
        /// The maximum number of results to return.
        public let limit: Int?
        /// A name prefix to filter the archives returned. Only archives with name that match the prefix are returned.
        public let namePrefix: String?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?
        /// The state of the archive.
        public let state: ArchiveState?

        public init(eventSourceArn: String? = nil, limit: Int? = nil, namePrefix: String? = nil, nextToken: String? = nil, state: ArchiveState? = nil) {
            self.eventSourceArn = eventSourceArn
            self.limit = limit
            self.namePrefix = namePrefix
            self.nextToken = nextToken
            self.state = state
        }

        public func validate(name: String) throws {
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, max: 1600)
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, min: 1)
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, max: 48)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case eventSourceArn = "EventSourceArn"
            case limit = "Limit"
            case namePrefix = "NamePrefix"
            case nextToken = "NextToken"
            case state = "State"
        }
    }

    public struct ListArchivesResponse: AWSDecodableShape {
        /// An array of Archive objects that include details about an archive.
        public let archives: [Archive]?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?

        public init(archives: [Archive]? = nil, nextToken: String? = nil) {
            self.archives = archives
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case archives = "Archives"
            case nextToken = "NextToken"
        }
    }

    public struct ListEventBusesRequest: AWSEncodableShape {
        /// Specifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
        public let limit: Int?
        /// Specifying this limits the results to only those event buses with names that start with the specified prefix.
        public let namePrefix: String?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?

        public init(limit: Int? = nil, namePrefix: String? = nil, nextToken: String? = nil) {
            self.limit = limit
            self.namePrefix = namePrefix
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, max: 256)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, pattern: "[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case limit = "Limit"
            case namePrefix = "NamePrefix"
            case nextToken = "NextToken"
        }
    }

    public struct ListEventBusesResponse: AWSDecodableShape {
        /// This list of event buses.
        public let eventBuses: [EventBus]?
        /// A token you can use in a subsequent operation to retrieve the next set of results.
        public let nextToken: String?

        public init(eventBuses: [EventBus]? = nil, nextToken: String? = nil) {
            self.eventBuses = eventBuses
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case eventBuses = "EventBuses"
            case nextToken = "NextToken"
        }
    }

    public struct ListEventSourcesRequest: AWSEncodableShape {
        /// Specifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
        public let limit: Int?
        /// Specifying this limits the results to only those partner event sources with names that start with the specified prefix.
        public let namePrefix: String?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?

        public init(limit: Int? = nil, namePrefix: String? = nil, nextToken: String? = nil) {
            self.limit = limit
            self.namePrefix = namePrefix
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, max: 256)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, pattern: "[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case limit = "Limit"
            case namePrefix = "NamePrefix"
            case nextToken = "NextToken"
        }
    }

    public struct ListEventSourcesResponse: AWSDecodableShape {
        /// The list of event sources.
        public let eventSources: [EventSource]?
        /// A token you can use in a subsequent operation to retrieve the next set of results.
        public let nextToken: String?

        public init(eventSources: [EventSource]? = nil, nextToken: String? = nil) {
            self.eventSources = eventSources
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case eventSources = "EventSources"
            case nextToken = "NextToken"
        }
    }

    public struct ListPartnerEventSourceAccountsRequest: AWSEncodableShape {
        /// The name of the partner event source to display account information about.
        public let eventSourceName: String
        /// Specifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
        public let limit: Int?
        /// The token returned by a previous call to this operation. Specifying this retrieves the next set of results.
        public let nextToken: String?

        public init(eventSourceName: String, limit: Int? = nil, nextToken: String? = nil) {
            self.eventSourceName = eventSourceName
            self.limit = limit
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.eventSourceName, name: "eventSourceName", parent: name, max: 256)
            try self.validate(self.eventSourceName, name: "eventSourceName", parent: name, min: 1)
            try self.validate(self.eventSourceName, name: "eventSourceName", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case eventSourceName = "EventSourceName"
            case limit = "Limit"
            case nextToken = "NextToken"
        }
    }

    public struct ListPartnerEventSourceAccountsResponse: AWSDecodableShape {
        /// A token you can use in a subsequent operation to retrieve the next set of results.
        public let nextToken: String?
        /// The list of partner event sources returned by the operation.
        public let partnerEventSourceAccounts: [PartnerEventSourceAccount]?

        public init(nextToken: String? = nil, partnerEventSourceAccounts: [PartnerEventSourceAccount]? = nil) {
            self.nextToken = nextToken
            self.partnerEventSourceAccounts = partnerEventSourceAccounts
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case partnerEventSourceAccounts = "PartnerEventSourceAccounts"
        }
    }

    public struct ListPartnerEventSourcesRequest: AWSEncodableShape {
        /// pecifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
        public let limit: Int?
        /// If you specify this, the results are limited to only those partner event sources that start with the string you specify.
        public let namePrefix: String
        /// The token returned by a previous call to this operation. Specifying this retrieves the next set of results.
        public let nextToken: String?

        public init(limit: Int? = nil, namePrefix: String, nextToken: String? = nil) {
            self.limit = limit
            self.namePrefix = namePrefix
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, max: 256)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, pattern: "aws\\.partner/[\\.\\-_A-Za-z0-9]+/[/\\.\\-_A-Za-z0-9]*")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case limit = "Limit"
            case namePrefix = "NamePrefix"
            case nextToken = "NextToken"
        }
    }

    public struct ListPartnerEventSourcesResponse: AWSDecodableShape {
        /// A token you can use in a subsequent operation to retrieve the next set of results.
        public let nextToken: String?
        /// The list of partner event sources returned by the operation.
        public let partnerEventSources: [PartnerEventSource]?

        public init(nextToken: String? = nil, partnerEventSources: [PartnerEventSource]? = nil) {
            self.nextToken = nextToken
            self.partnerEventSources = partnerEventSources
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case partnerEventSources = "PartnerEventSources"
        }
    }

    public struct ListReplaysRequest: AWSEncodableShape {
        /// The ARN of the event source associated with the replay.
        public let eventSourceArn: String?
        /// The maximum number of replays to retrieve.
        public let limit: Int?
        /// A name prefix to filter the replays returned. Only replays with name that match the prefix are returned.
        public let namePrefix: String?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?
        /// The state of the replay.
        public let state: ReplayState?

        public init(eventSourceArn: String? = nil, limit: Int? = nil, namePrefix: String? = nil, nextToken: String? = nil, state: ReplayState? = nil) {
            self.eventSourceArn = eventSourceArn
            self.limit = limit
            self.namePrefix = namePrefix
            self.nextToken = nextToken
            self.state = state
        }

        public func validate(name: String) throws {
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, max: 1600)
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, min: 1)
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, max: 64)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case eventSourceArn = "EventSourceArn"
            case limit = "Limit"
            case namePrefix = "NamePrefix"
            case nextToken = "NextToken"
            case state = "State"
        }
    }

    public struct ListReplaysResponse: AWSDecodableShape {
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?
        /// An array of Replay objects that contain information about the replay.
        public let replays: [Replay]?

        public init(nextToken: String? = nil, replays: [Replay]? = nil) {
            self.nextToken = nextToken
            self.replays = replays
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case replays = "Replays"
        }
    }

    public struct ListRuleNamesByTargetRequest: AWSEncodableShape {
        /// The name or ARN of the event bus to list rules for. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The maximum number of results to return.
        public let limit: Int?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?
        /// The Amazon Resource Name (ARN) of the target resource.
        public let targetArn: String

        public init(eventBusName: String? = nil, limit: Int? = nil, nextToken: String? = nil, targetArn: String) {
            self.eventBusName = eventBusName
            self.limit = limit
            self.nextToken = nextToken
            self.targetArn = targetArn
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.targetArn, name: "targetArn", parent: name, max: 1600)
            try self.validate(self.targetArn, name: "targetArn", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case limit = "Limit"
            case nextToken = "NextToken"
            case targetArn = "TargetArn"
        }
    }

    public struct ListRuleNamesByTargetResponse: AWSDecodableShape {
        /// Indicates whether there are additional results to retrieve. If there are no more results, the value is null.
        public let nextToken: String?
        /// The names of the rules that can invoke the given target.
        public let ruleNames: [String]?

        public init(nextToken: String? = nil, ruleNames: [String]? = nil) {
            self.nextToken = nextToken
            self.ruleNames = ruleNames
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case ruleNames = "RuleNames"
        }
    }

    public struct ListRulesRequest: AWSEncodableShape {
        /// The name or ARN of the event bus to list the rules for. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The maximum number of results to return.
        public let limit: Int?
        /// The prefix matching the rule name.
        public let namePrefix: String?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?

        public init(eventBusName: String? = nil, limit: Int? = nil, namePrefix: String? = nil, nextToken: String? = nil) {
            self.eventBusName = eventBusName
            self.limit = limit
            self.namePrefix = namePrefix
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, max: 64)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, min: 1)
            try self.validate(self.namePrefix, name: "namePrefix", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case limit = "Limit"
            case namePrefix = "NamePrefix"
            case nextToken = "NextToken"
        }
    }

    public struct ListRulesResponse: AWSDecodableShape {
        /// Indicates whether there are additional results to retrieve. If there are no more results, the value is null.
        public let nextToken: String?
        /// The rules that match the specified criteria.
        public let rules: [Rule]?

        public init(nextToken: String? = nil, rules: [Rule]? = nil) {
            self.nextToken = nextToken
            self.rules = rules
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case rules = "Rules"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The ARN of the EventBridge resource for which you want to view tags.
        public let resourceARN: String

        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1600)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The list of tag keys and values associated with the resource you specified
        public let tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct ListTargetsByRuleRequest: AWSEncodableShape {
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The maximum number of results to return.
        public let limit: Int?
        /// The token returned by a previous call to retrieve the next set of results.
        public let nextToken: String?
        /// The name of the rule.
        public let rule: String

        public init(eventBusName: String? = nil, limit: Int? = nil, nextToken: String? = nil, rule: String) {
            self.eventBusName = eventBusName
            self.limit = limit
            self.nextToken = nextToken
            self.rule = rule
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.limit, name: "limit", parent: name, max: 100)
            try self.validate(self.limit, name: "limit", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.rule, name: "rule", parent: name, max: 64)
            try self.validate(self.rule, name: "rule", parent: name, min: 1)
            try self.validate(self.rule, name: "rule", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case limit = "Limit"
            case nextToken = "NextToken"
            case rule = "Rule"
        }
    }

    public struct ListTargetsByRuleResponse: AWSDecodableShape {
        /// Indicates whether there are additional results to retrieve. If there are no more results, the value is null.
        public let nextToken: String?
        /// The targets assigned to the rule.
        public let targets: [Target]?

        public init(nextToken: String? = nil, targets: [Target]? = nil) {
            self.nextToken = nextToken
            self.targets = targets
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case targets = "Targets"
        }
    }

    public struct NetworkConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Use this structure to specify the VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.
        public let awsvpcConfiguration: AwsVpcConfiguration?

        public init(awsvpcConfiguration: AwsVpcConfiguration? = nil) {
            self.awsvpcConfiguration = awsvpcConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case awsvpcConfiguration
        }
    }

    public struct PartnerEventSource: AWSDecodableShape {
        /// The ARN of the partner event source.
        public let arn: String?
        /// The name of the partner event source.
        public let name: String?

        public init(arn: String? = nil, name: String? = nil) {
            self.arn = arn
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case name = "Name"
        }
    }

    public struct PartnerEventSourceAccount: AWSDecodableShape {
        /// The AWS account ID that the partner event source was offered to.
        public let account: String?
        /// The date and time the event source was created.
        public let creationTime: Date?
        /// The date and time that the event source will expire, if the AWS account doesn't create a matching event bus for it.
        public let expirationTime: Date?
        /// The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has since been deleted.
        public let state: EventSourceState?

        public init(account: String? = nil, creationTime: Date? = nil, expirationTime: Date? = nil, state: EventSourceState? = nil) {
            self.account = account
            self.creationTime = creationTime
            self.expirationTime = expirationTime
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case account = "Account"
            case creationTime = "CreationTime"
            case expirationTime = "ExpirationTime"
            case state = "State"
        }
    }

    public struct PutEventsRequest: AWSEncodableShape {
        /// The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.
        public let entries: [PutEventsRequestEntry]

        public init(entries: [PutEventsRequestEntry]) {
            self.entries = entries
        }

        public func validate(name: String) throws {
            try self.entries.forEach {
                try $0.validate(name: "\(name).entries[]")
            }
            try self.validate(self.entries, name: "entries", parent: name, max: 10)
            try self.validate(self.entries, name: "entries", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case entries = "Entries"
        }
    }

    public struct PutEventsRequestEntry: AWSEncodableShape {
        /// A valid JSON string. There is no other schema imposed. The JSON string may contain fields and nested subobjects.
        public let detail: String?
        /// Free-form string used to decide what fields to expect in the event detail.
        public let detailType: String?
        /// The name or ARN of the event bus to receive the event. Only the rules that are associated with this event bus are used to match the event. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// AWS resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. Any number, including zero, may be present.
        public let resources: [String]?
        /// The source of the event.
        public let source: String?
        /// The time stamp of the event, per RFC3339. If no time stamp is provided, the time stamp of the PutEvents call is used.
        public let time: Date?

        public init(detail: String? = nil, detailType: String? = nil, eventBusName: String? = nil, resources: [String]? = nil, source: String? = nil, time: Date? = nil) {
            self.detail = detail
            self.detailType = detailType
            self.eventBusName = eventBusName
            self.resources = resources
            self.source = source
            self.time = time
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case detail = "Detail"
            case detailType = "DetailType"
            case eventBusName = "EventBusName"
            case resources = "Resources"
            case source = "Source"
            case time = "Time"
        }
    }

    public struct PutEventsResponse: AWSDecodableShape {
        /// The successfully and unsuccessfully ingested events results. If the ingestion was successful, the entry has the event ID in it. Otherwise, you can use the error code and error message to identify the problem with the entry.
        public let entries: [PutEventsResultEntry]?
        /// The number of failed entries.
        public let failedEntryCount: Int?

        public init(entries: [PutEventsResultEntry]? = nil, failedEntryCount: Int? = nil) {
            self.entries = entries
            self.failedEntryCount = failedEntryCount
        }

        private enum CodingKeys: String, CodingKey {
            case entries = "Entries"
            case failedEntryCount = "FailedEntryCount"
        }
    }

    public struct PutEventsResultEntry: AWSDecodableShape {
        /// The error code that indicates why the event submission failed.
        public let errorCode: String?
        /// The error message that explains why the event submission failed.
        public let errorMessage: String?
        /// The ID of the event.
        public let eventId: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil, eventId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.eventId = eventId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case eventId = "EventId"
        }
    }

    public struct PutPartnerEventsRequest: AWSEncodableShape {
        /// The list of events to write to the event bus.
        public let entries: [PutPartnerEventsRequestEntry]

        public init(entries: [PutPartnerEventsRequestEntry]) {
            self.entries = entries
        }

        public func validate(name: String) throws {
            try self.entries.forEach {
                try $0.validate(name: "\(name).entries[]")
            }
            try self.validate(self.entries, name: "entries", parent: name, max: 20)
            try self.validate(self.entries, name: "entries", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case entries = "Entries"
        }
    }

    public struct PutPartnerEventsRequestEntry: AWSEncodableShape {
        /// A valid JSON string. There is no other schema imposed. The JSON string may contain fields and nested subobjects.
        public let detail: String?
        /// A free-form string used to decide what fields to expect in the event detail.
        public let detailType: String?
        /// AWS resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. Any number, including zero, may be present.
        public let resources: [String]?
        /// The event source that is generating the evntry.
        public let source: String?
        /// The date and time of the event.
        public let time: Date?

        public init(detail: String? = nil, detailType: String? = nil, resources: [String]? = nil, source: String? = nil, time: Date? = nil) {
            self.detail = detail
            self.detailType = detailType
            self.resources = resources
            self.source = source
            self.time = time
        }

        public func validate(name: String) throws {
            try self.validate(self.source, name: "source", parent: name, max: 256)
            try self.validate(self.source, name: "source", parent: name, min: 1)
            try self.validate(self.source, name: "source", parent: name, pattern: "aws\\.partner(/[\\.\\-_A-Za-z0-9]+){2,}")
        }

        private enum CodingKeys: String, CodingKey {
            case detail = "Detail"
            case detailType = "DetailType"
            case resources = "Resources"
            case source = "Source"
            case time = "Time"
        }
    }

    public struct PutPartnerEventsResponse: AWSDecodableShape {
        /// The list of events from this operation that were successfully written to the partner event bus.
        public let entries: [PutPartnerEventsResultEntry]?
        /// The number of events from this operation that could not be written to the partner event bus.
        public let failedEntryCount: Int?

        public init(entries: [PutPartnerEventsResultEntry]? = nil, failedEntryCount: Int? = nil) {
            self.entries = entries
            self.failedEntryCount = failedEntryCount
        }

        private enum CodingKeys: String, CodingKey {
            case entries = "Entries"
            case failedEntryCount = "FailedEntryCount"
        }
    }

    public struct PutPartnerEventsResultEntry: AWSDecodableShape {
        /// The error code that indicates why the event submission failed.
        public let errorCode: String?
        /// The error message that explains why the event submission failed.
        public let errorMessage: String?
        /// The ID of the event.
        public let eventId: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil, eventId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.eventId = eventId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case eventId = "EventId"
        }
    }

    public struct PutPermissionRequest: AWSEncodableShape {
        /// The action that you are enabling the other account to perform. Currently, this must be events:PutEvents.
        public let action: String?
        /// This parameter enables you to limit the permission to accounts that fulfill a certain condition, such as being a member of a certain AWS organization. For more information about AWS Organizations, see What Is AWS Organizations in the AWS Organizations User Guide. If you specify Condition with an AWS organization ID, and specify "*" as the value for Principal, you grant permission to all the accounts in the named organization. The Condition is a JSON string which must contain Type, Key, and Value fields.
        public let condition: Condition?
        /// The name of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// A JSON string that describes the permission policy statement. You can include a Policy parameter in the request instead of using the StatementId, Action, Principal, or Condition parameters.
        public let policy: String?
        /// The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify "*" to permit any account to put events to your default event bus. If you specify "*" without specifying Condition, avoid creating rules that may match undesirable events. To create more secure rules, make sure that the event pattern for each rule contains an account field with a specific account ID from which to receive events. Rules with an account field do not match any events sent from other accounts.
        public let principal: String?
        /// An identifier string for the external account that you are granting permissions to. If you later want to revoke the permission for this external account, specify this StatementId when you run RemovePermission.
        public let statementId: String?

        public init(action: String? = nil, condition: Condition? = nil, eventBusName: String? = nil, policy: String? = nil, principal: String? = nil, statementId: String? = nil) {
            self.action = action
            self.condition = condition
            self.eventBusName = eventBusName
            self.policy = policy
            self.principal = principal
            self.statementId = statementId
        }

        public func validate(name: String) throws {
            try self.validate(self.action, name: "action", parent: name, max: 64)
            try self.validate(self.action, name: "action", parent: name, min: 1)
            try self.validate(self.action, name: "action", parent: name, pattern: "events:[a-zA-Z]+")
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 256)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.principal, name: "principal", parent: name, max: 12)
            try self.validate(self.principal, name: "principal", parent: name, min: 1)
            try self.validate(self.principal, name: "principal", parent: name, pattern: "(\\d{12}|\\*)")
            try self.validate(self.statementId, name: "statementId", parent: name, max: 64)
            try self.validate(self.statementId, name: "statementId", parent: name, min: 1)
            try self.validate(self.statementId, name: "statementId", parent: name, pattern: "[a-zA-Z0-9-_]+")
        }

        private enum CodingKeys: String, CodingKey {
            case action = "Action"
            case condition = "Condition"
            case eventBusName = "EventBusName"
            case policy = "Policy"
            case principal = "Principal"
            case statementId = "StatementId"
        }
    }

    public struct PutRuleRequest: AWSEncodableShape {
        /// A description of the rule.
        public let description: String?
        /// The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The event pattern. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
        public let eventPattern: String?
        /// The name of the rule that you are creating or updating.
        public let name: String
        /// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
        public let roleArn: String?
        /// The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".
        public let scheduleExpression: String?
        /// Indicates whether the rule is enabled or disabled.
        public let state: RuleState?
        /// The list of key-value pairs to associate with the rule.
        public let tags: [Tag]?

        public init(description: String? = nil, eventBusName: String? = nil, eventPattern: String? = nil, name: String, roleArn: String? = nil, scheduleExpression: String? = nil, state: RuleState? = nil, tags: [Tag]? = nil) {
            self.description = description
            self.eventBusName = eventBusName
            self.eventPattern = eventPattern
            self.name = name
            self.roleArn = roleArn
            self.scheduleExpression = scheduleExpression
            self.state = state
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 512)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1600)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.validate(self.scheduleExpression, name: "scheduleExpression", parent: name, max: 256)
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case eventBusName = "EventBusName"
            case eventPattern = "EventPattern"
            case name = "Name"
            case roleArn = "RoleArn"
            case scheduleExpression = "ScheduleExpression"
            case state = "State"
            case tags = "Tags"
        }
    }

    public struct PutRuleResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the rule.
        public let ruleArn: String?

        public init(ruleArn: String? = nil) {
            self.ruleArn = ruleArn
        }

        private enum CodingKeys: String, CodingKey {
            case ruleArn = "RuleArn"
        }
    }

    public struct PutTargetsRequest: AWSEncodableShape {
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The name of the rule.
        public let rule: String
        /// The targets to update or add to the rule.
        public let targets: [Target]

        public init(eventBusName: String? = nil, rule: String, targets: [Target]) {
            self.eventBusName = eventBusName
            self.rule = rule
            self.targets = targets
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.validate(self.rule, name: "rule", parent: name, max: 64)
            try self.validate(self.rule, name: "rule", parent: name, min: 1)
            try self.validate(self.rule, name: "rule", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.targets.forEach {
                try $0.validate(name: "\(name).targets[]")
            }
            try self.validate(self.targets, name: "targets", parent: name, max: 100)
            try self.validate(self.targets, name: "targets", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case rule = "Rule"
            case targets = "Targets"
        }
    }

    public struct PutTargetsResponse: AWSDecodableShape {
        /// The failed target entries.
        public let failedEntries: [PutTargetsResultEntry]?
        /// The number of failed entries.
        public let failedEntryCount: Int?

        public init(failedEntries: [PutTargetsResultEntry]? = nil, failedEntryCount: Int? = nil) {
            self.failedEntries = failedEntries
            self.failedEntryCount = failedEntryCount
        }

        private enum CodingKeys: String, CodingKey {
            case failedEntries = "FailedEntries"
            case failedEntryCount = "FailedEntryCount"
        }
    }

    public struct PutTargetsResultEntry: AWSDecodableShape {
        /// The error code that indicates why the target addition failed. If the value is ConcurrentModificationException, too many requests were made at the same time.
        public let errorCode: String?
        /// The error message that explains why the target addition failed.
        public let errorMessage: String?
        /// The ID of the target.
        public let targetId: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil, targetId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.targetId = targetId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case targetId = "TargetId"
        }
    }

    public struct RedshiftDataParameters: AWSEncodableShape & AWSDecodableShape {
        /// The name of the database. Required when authenticating using temporary credentials.
        public let database: String
        /// The database user name. Required when authenticating using temporary credentials.
        public let dbUser: String?
        /// The name or ARN of the secret that enables access to the database. Required when authenticating using AWS Secrets Manager.
        public let secretManagerArn: String?
        /// The SQL statement text to run.
        public let sql: String
        /// The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
        public let statementName: String?
        /// Indicates whether to send an event back to EventBridge after the SQL statement runs.
        public let withEvent: Bool?

        public init(database: String, dbUser: String? = nil, secretManagerArn: String? = nil, sql: String, statementName: String? = nil, withEvent: Bool? = nil) {
            self.database = database
            self.dbUser = dbUser
            self.secretManagerArn = secretManagerArn
            self.sql = sql
            self.statementName = statementName
            self.withEvent = withEvent
        }

        public func validate(name: String) throws {
            try self.validate(self.database, name: "database", parent: name, max: 64)
            try self.validate(self.database, name: "database", parent: name, min: 1)
            try self.validate(self.database, name: "database", parent: name, pattern: "([a-zA-Z0-9]+)|(\\$(\\.[\\w_-]+(\\[(\\d+|\\*)\\])*)*)")
            try self.validate(self.dbUser, name: "dbUser", parent: name, max: 128)
            try self.validate(self.dbUser, name: "dbUser", parent: name, min: 1)
            try self.validate(self.dbUser, name: "dbUser", parent: name, pattern: "([a-zA-Z0-9]+)|(\\$(\\.[\\w_-]+(\\[(\\d+|\\*)\\])*)*)")
            try self.validate(self.secretManagerArn, name: "secretManagerArn", parent: name, max: 1600)
            try self.validate(self.secretManagerArn, name: "secretManagerArn", parent: name, min: 1)
            try self.validate(self.secretManagerArn, name: "secretManagerArn", parent: name, pattern: "(^arn:aws([a-z]|\\-)*:secretsmanager:[a-z0-9-.]+:.*)|(\\$(\\.[\\w_-]+(\\[(\\d+|\\*)\\])*)*)")
            try self.validate(self.sql, name: "sql", parent: name, max: 100_000)
            try self.validate(self.sql, name: "sql", parent: name, min: 1)
            try self.validate(self.statementName, name: "statementName", parent: name, max: 500)
            try self.validate(self.statementName, name: "statementName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case database = "Database"
            case dbUser = "DbUser"
            case secretManagerArn = "SecretManagerArn"
            case sql = "Sql"
            case statementName = "StatementName"
            case withEvent = "WithEvent"
        }
    }

    public struct RemovePermissionRequest: AWSEncodableShape {
        /// The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// Specifies whether to remove all permissions.
        public let removeAllPermissions: Bool?
        /// The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.
        public let statementId: String?

        public init(eventBusName: String? = nil, removeAllPermissions: Bool? = nil, statementId: String? = nil) {
            self.eventBusName = eventBusName
            self.removeAllPermissions = removeAllPermissions
            self.statementId = statementId
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 256)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.statementId, name: "statementId", parent: name, max: 64)
            try self.validate(self.statementId, name: "statementId", parent: name, min: 1)
            try self.validate(self.statementId, name: "statementId", parent: name, pattern: "[a-zA-Z0-9-_]+")
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case removeAllPermissions = "RemoveAllPermissions"
            case statementId = "StatementId"
        }
    }

    public struct RemoveTargetsRequest: AWSEncodableShape {
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// If this is a managed rule, created by an AWS service on your behalf, you must specify Force as True to remove targets. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using DescribeRule or ListRules and checking the ManagedBy field of the response.
        public let force: Bool?
        /// The IDs of the targets to remove from the rule.
        public let ids: [String]
        /// The name of the rule.
        public let rule: String

        public init(eventBusName: String? = nil, force: Bool? = nil, ids: [String], rule: String) {
            self.eventBusName = eventBusName
            self.force = force
            self.ids = ids
            self.rule = rule
        }

        public func validate(name: String) throws {
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, max: 1600)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, min: 1)
            try self.validate(self.eventBusName, name: "eventBusName", parent: name, pattern: "(arn:aws[\\w-]*:events:[a-z]{2}-[a-z]+-[\\w-]+:[0-9]{12}:event-bus\\/)?[/\\.\\-_A-Za-z0-9]+")
            try self.ids.forEach {
                try validate($0, name: "ids[]", parent: name, max: 64)
                try validate($0, name: "ids[]", parent: name, min: 1)
                try validate($0, name: "ids[]", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            }
            try self.validate(self.ids, name: "ids", parent: name, max: 100)
            try self.validate(self.ids, name: "ids", parent: name, min: 1)
            try self.validate(self.rule, name: "rule", parent: name, max: 64)
            try self.validate(self.rule, name: "rule", parent: name, min: 1)
            try self.validate(self.rule, name: "rule", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case eventBusName = "EventBusName"
            case force = "Force"
            case ids = "Ids"
            case rule = "Rule"
        }
    }

    public struct RemoveTargetsResponse: AWSDecodableShape {
        /// The failed target entries.
        public let failedEntries: [RemoveTargetsResultEntry]?
        /// The number of failed entries.
        public let failedEntryCount: Int?

        public init(failedEntries: [RemoveTargetsResultEntry]? = nil, failedEntryCount: Int? = nil) {
            self.failedEntries = failedEntries
            self.failedEntryCount = failedEntryCount
        }

        private enum CodingKeys: String, CodingKey {
            case failedEntries = "FailedEntries"
            case failedEntryCount = "FailedEntryCount"
        }
    }

    public struct RemoveTargetsResultEntry: AWSDecodableShape {
        /// The error code that indicates why the target removal failed. If the value is ConcurrentModificationException, too many requests were made at the same time.
        public let errorCode: String?
        /// The error message that explains why the target removal failed.
        public let errorMessage: String?
        /// The ID of the target.
        public let targetId: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil, targetId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.targetId = targetId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case targetId = "TargetId"
        }
    }

    public struct Replay: AWSDecodableShape {
        /// A time stamp for the time to start replaying events. Any event with a creation time prior to the EventEndTime specified is replayed.
        public let eventEndTime: Date?
        /// A time stamp for the time that the last event was replayed.
        public let eventLastReplayedTime: Date?
        /// The ARN of the archive to replay event from.
        public let eventSourceArn: String?
        /// A time stamp for the time to start replaying events. This is determined by the time in the event as described in Time.
        public let eventStartTime: Date?
        /// A time stamp for the time that the replay completed.
        public let replayEndTime: Date?
        /// The name of the replay.
        public let replayName: String?
        /// A time stamp for the time that the replay started.
        public let replayStartTime: Date?
        /// The current state of the replay.
        public let state: ReplayState?
        /// A description of why the replay is in the current state.
        public let stateReason: String?

        public init(eventEndTime: Date? = nil, eventLastReplayedTime: Date? = nil, eventSourceArn: String? = nil, eventStartTime: Date? = nil, replayEndTime: Date? = nil, replayName: String? = nil, replayStartTime: Date? = nil, state: ReplayState? = nil, stateReason: String? = nil) {
            self.eventEndTime = eventEndTime
            self.eventLastReplayedTime = eventLastReplayedTime
            self.eventSourceArn = eventSourceArn
            self.eventStartTime = eventStartTime
            self.replayEndTime = replayEndTime
            self.replayName = replayName
            self.replayStartTime = replayStartTime
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case eventEndTime = "EventEndTime"
            case eventLastReplayedTime = "EventLastReplayedTime"
            case eventSourceArn = "EventSourceArn"
            case eventStartTime = "EventStartTime"
            case replayEndTime = "ReplayEndTime"
            case replayName = "ReplayName"
            case replayStartTime = "ReplayStartTime"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct ReplayDestination: AWSEncodableShape & AWSDecodableShape {
        /// The ARN of the event bus to replay event to. You can replay events only to the event bus specified to create the archive.
        public let arn: String
        /// A list of ARNs for rules to replay events to.
        public let filterArns: [String]?

        public init(arn: String, filterArns: [String]? = nil) {
            self.arn = arn
            self.filterArns = filterArns
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 1600)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.filterArns?.forEach {
                try validate($0, name: "filterArns[]", parent: name, max: 1600)
                try validate($0, name: "filterArns[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case filterArns = "FilterArns"
        }
    }

    public struct RetryPolicy: AWSEncodableShape & AWSDecodableShape {
        /// The maximum amount of time, in seconds, to continue to make retry attempts.
        public let maximumEventAgeInSeconds: Int?
        /// The maximum number of retry attempts to make before the request fails. Retry attempts continue until either the maximum number of attempts is made or until the duration of the MaximumEventAgeInSeconds is met.
        public let maximumRetryAttempts: Int?

        public init(maximumEventAgeInSeconds: Int? = nil, maximumRetryAttempts: Int? = nil) {
            self.maximumEventAgeInSeconds = maximumEventAgeInSeconds
            self.maximumRetryAttempts = maximumRetryAttempts
        }

        public func validate(name: String) throws {
            try self.validate(self.maximumEventAgeInSeconds, name: "maximumEventAgeInSeconds", parent: name, max: 86400)
            try self.validate(self.maximumEventAgeInSeconds, name: "maximumEventAgeInSeconds", parent: name, min: 60)
            try self.validate(self.maximumRetryAttempts, name: "maximumRetryAttempts", parent: name, max: 185)
            try self.validate(self.maximumRetryAttempts, name: "maximumRetryAttempts", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case maximumEventAgeInSeconds = "MaximumEventAgeInSeconds"
            case maximumRetryAttempts = "MaximumRetryAttempts"
        }
    }

    public struct Rule: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the rule.
        public let arn: String?
        /// The description of the rule.
        public let description: String?
        /// The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
        public let eventBusName: String?
        /// The event pattern of the rule. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
        public let eventPattern: String?
        /// If the rule was created on behalf of your account by an AWS service, this field displays the principal name of the service that created the rule.
        public let managedBy: String?
        /// The name of the rule.
        public let name: String?
        /// The Amazon Resource Name (ARN) of the role that is used for target invocation.
        public let roleArn: String?
        /// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
        public let scheduleExpression: String?
        /// The state of the rule.
        public let state: RuleState?

        public init(arn: String? = nil, description: String? = nil, eventBusName: String? = nil, eventPattern: String? = nil, managedBy: String? = nil, name: String? = nil, roleArn: String? = nil, scheduleExpression: String? = nil, state: RuleState? = nil) {
            self.arn = arn
            self.description = description
            self.eventBusName = eventBusName
            self.eventPattern = eventPattern
            self.managedBy = managedBy
            self.name = name
            self.roleArn = roleArn
            self.scheduleExpression = scheduleExpression
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case description = "Description"
            case eventBusName = "EventBusName"
            case eventPattern = "EventPattern"
            case managedBy = "ManagedBy"
            case name = "Name"
            case roleArn = "RoleArn"
            case scheduleExpression = "ScheduleExpression"
            case state = "State"
        }
    }

    public struct RunCommandParameters: AWSEncodableShape & AWSDecodableShape {
        /// Currently, we support including only one RunCommandTarget block, which specifies either an array of InstanceIds or a tag.
        public let runCommandTargets: [RunCommandTarget]

        public init(runCommandTargets: [RunCommandTarget]) {
            self.runCommandTargets = runCommandTargets
        }

        public func validate(name: String) throws {
            try self.runCommandTargets.forEach {
                try $0.validate(name: "\(name).runCommandTargets[]")
            }
            try self.validate(self.runCommandTargets, name: "runCommandTargets", parent: name, max: 5)
            try self.validate(self.runCommandTargets, name: "runCommandTargets", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case runCommandTargets = "RunCommandTargets"
        }
    }

    public struct RunCommandTarget: AWSEncodableShape & AWSDecodableShape {
        /// Can be either tag: tag-key or InstanceIds.
        public let key: String
        /// If Key is tag: tag-key, Values is a list of tag values. If Key is InstanceIds, Values is a list of Amazon EC2 instance IDs.
        public let values: [String]

        public init(key: String, values: [String]) {
            self.key = key
            self.values = values
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
            try self.values.forEach {
                try validate($0, name: "values[]", parent: name, max: 256)
                try validate($0, name: "values[]", parent: name, min: 1)
            }
            try self.validate(self.values, name: "values", parent: name, max: 50)
            try self.validate(self.values, name: "values", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case values = "Values"
        }
    }

    public struct SqsParameters: AWSEncodableShape & AWSDecodableShape {
        /// The FIFO message group ID to use as the target.
        public let messageGroupId: String?

        public init(messageGroupId: String? = nil) {
            self.messageGroupId = messageGroupId
        }

        private enum CodingKeys: String, CodingKey {
            case messageGroupId = "MessageGroupId"
        }
    }

    public struct StartReplayRequest: AWSEncodableShape {
        /// A description for the replay to start.
        public let description: String?
        /// A ReplayDestination object that includes details about the destination for the replay.
        public let destination: ReplayDestination
        /// A time stamp for the time to stop replaying events. Only events that occurred between the EventStartTime and EventEndTime are replayed.
        public let eventEndTime: Date
        /// The ARN of the archive to replay events from.
        public let eventSourceArn: String
        /// A time stamp for the time to start replaying events. Only events that occurred between the EventStartTime and EventEndTime are replayed.
        public let eventStartTime: Date
        /// The name of the replay to start.
        public let replayName: String

        public init(description: String? = nil, destination: ReplayDestination, eventEndTime: Date, eventSourceArn: String, eventStartTime: Date, replayName: String) {
            self.description = description
            self.destination = destination
            self.eventEndTime = eventEndTime
            self.eventSourceArn = eventSourceArn
            self.eventStartTime = eventStartTime
            self.replayName = replayName
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 512)
            try self.validate(self.description, name: "description", parent: name, pattern: ".*")
            try self.destination.validate(name: "\(name).destination")
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, max: 1600)
            try self.validate(self.eventSourceArn, name: "eventSourceArn", parent: name, min: 1)
            try self.validate(self.replayName, name: "replayName", parent: name, max: 64)
            try self.validate(self.replayName, name: "replayName", parent: name, min: 1)
            try self.validate(self.replayName, name: "replayName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case destination = "Destination"
            case eventEndTime = "EventEndTime"
            case eventSourceArn = "EventSourceArn"
            case eventStartTime = "EventStartTime"
            case replayName = "ReplayName"
        }
    }

    public struct StartReplayResponse: AWSDecodableShape {
        /// The ARN of the replay.
        public let replayArn: String?
        /// The time at which the replay started.
        public let replayStartTime: Date?
        /// The state of the replay.
        public let state: ReplayState?
        /// The reason that the replay is in the state.
        public let stateReason: String?

        public init(replayArn: String? = nil, replayStartTime: Date? = nil, state: ReplayState? = nil, stateReason: String? = nil) {
            self.replayArn = replayArn
            self.replayStartTime = replayStartTime
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case replayArn = "ReplayArn"
            case replayStartTime = "ReplayStartTime"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// A string you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.
        public let key: String
        /// The value for the specified tag key.
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The ARN of the EventBridge resource that you're adding tags to.
        public let resourceARN: String
        /// The list of key-value pairs to associate with the resource.
        public let tags: [Tag]

        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1600)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Target: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the target.
        public let arn: String
        /// If the event target is an AWS Batch job, this contains the job definition, job name, and other parameters. For more information, see Jobs in the AWS Batch User Guide.
        public let batchParameters: BatchParameters?
        /// The DeadLetterConfig that defines the target queue to send dead-letter queue events to.
        public let deadLetterConfig: DeadLetterConfig?
        /// Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task. For more information about Amazon ECS tasks, see Task Definitions  in the Amazon EC2 Container Service Developer Guide.
        public let ecsParameters: EcsParameters?
        /// Contains the HTTP parameters to use when the target is a API Gateway REST endpoint. If you specify an API Gateway REST API as a target, you can use this parameter to specify headers, path parameter, query string keys/values as part of your target invoking request.
        public let httpParameters: HttpParameters?
        /// The ID of the target.
        public let id: String
        /// Valid JSON text passed to the target. In this case, nothing from the event itself is passed to the target. For more information, see The JavaScript Object Notation (JSON) Data Interchange Format.
        public let input: String?
        /// The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. You must use JSON dot notation, not bracket notation. For more information about JSON paths, see JSONPath.
        public let inputPath: String?
        /// Settings to enable you to provide custom input to a target based on certain event data. You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.
        public let inputTransformer: InputTransformer?
        /// The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream. If you do not include this parameter, the default is to use the eventId as the partition key.
        public let kinesisParameters: KinesisParameters?
        /// Contains the Redshift Data API parameters to use when the target is a Redshift cluster. If you specify a Redshift Cluster as a Target, you can use this to specify parameters to invoke the Redshift Data API ExecuteStatement based on EventBridge events.
        public let redshiftDataParameters: RedshiftDataParameters?
        /// The RetryPolicy object that contains the retry policy configuration to use for the dead-letter queue.
        public let retryPolicy: RetryPolicy?
        /// The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. If one rule triggers multiple targets, you can use a different IAM role for each target.
        public let roleArn: String?
        /// Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
        public let runCommandParameters: RunCommandParameters?
        /// Contains the message group ID to use when the target is a FIFO queue. If you specify an SQS FIFO queue as a target, the queue must have content-based deduplication enabled.
        public let sqsParameters: SqsParameters?

        public init(arn: String, batchParameters: BatchParameters? = nil, deadLetterConfig: DeadLetterConfig? = nil, ecsParameters: EcsParameters? = nil, httpParameters: HttpParameters? = nil, id: String, input: String? = nil, inputPath: String? = nil, inputTransformer: InputTransformer? = nil, kinesisParameters: KinesisParameters? = nil, redshiftDataParameters: RedshiftDataParameters? = nil, retryPolicy: RetryPolicy? = nil, roleArn: String? = nil, runCommandParameters: RunCommandParameters? = nil, sqsParameters: SqsParameters? = nil) {
            self.arn = arn
            self.batchParameters = batchParameters
            self.deadLetterConfig = deadLetterConfig
            self.ecsParameters = ecsParameters
            self.httpParameters = httpParameters
            self.id = id
            self.input = input
            self.inputPath = inputPath
            self.inputTransformer = inputTransformer
            self.kinesisParameters = kinesisParameters
            self.redshiftDataParameters = redshiftDataParameters
            self.retryPolicy = retryPolicy
            self.roleArn = roleArn
            self.runCommandParameters = runCommandParameters
            self.sqsParameters = sqsParameters
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 1600)
            try self.validate(self.arn, name: "arn", parent: name, min: 1)
            try self.deadLetterConfig?.validate(name: "\(name).deadLetterConfig")
            try self.ecsParameters?.validate(name: "\(name).ecsParameters")
            try self.httpParameters?.validate(name: "\(name).httpParameters")
            try self.validate(self.id, name: "id", parent: name, max: 64)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.input, name: "input", parent: name, max: 8192)
            try self.validate(self.inputPath, name: "inputPath", parent: name, max: 256)
            try self.inputTransformer?.validate(name: "\(name).inputTransformer")
            try self.kinesisParameters?.validate(name: "\(name).kinesisParameters")
            try self.redshiftDataParameters?.validate(name: "\(name).redshiftDataParameters")
            try self.retryPolicy?.validate(name: "\(name).retryPolicy")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 1600)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 1)
            try self.runCommandParameters?.validate(name: "\(name).runCommandParameters")
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case batchParameters = "BatchParameters"
            case deadLetterConfig = "DeadLetterConfig"
            case ecsParameters = "EcsParameters"
            case httpParameters = "HttpParameters"
            case id = "Id"
            case input = "Input"
            case inputPath = "InputPath"
            case inputTransformer = "InputTransformer"
            case kinesisParameters = "KinesisParameters"
            case redshiftDataParameters = "RedshiftDataParameters"
            case retryPolicy = "RetryPolicy"
            case roleArn = "RoleArn"
            case runCommandParameters = "RunCommandParameters"
            case sqsParameters = "SqsParameters"
        }
    }

    public struct TestEventPatternRequest: AWSEncodableShape {
        /// The event, in JSON format, to test against the event pattern.
        public let event: String
        /// The event pattern. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
        public let eventPattern: String

        public init(event: String, eventPattern: String) {
            self.event = event
            self.eventPattern = eventPattern
        }

        private enum CodingKeys: String, CodingKey {
            case event = "Event"
            case eventPattern = "EventPattern"
        }
    }

    public struct TestEventPatternResponse: AWSDecodableShape {
        /// Indicates whether the event matches the event pattern.
        public let result: Bool?

        public init(result: Bool? = nil) {
            self.result = result
        }

        private enum CodingKeys: String, CodingKey {
            case result = "Result"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The ARN of the EventBridge resource from which you are removing tags.
        public let resourceARN: String
        /// The list of tag keys to remove from the resource.
        public let tagKeys: [String]

        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1600)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateArchiveRequest: AWSEncodableShape {
        /// The name of the archive to update.
        public let archiveName: String
        /// The description for the archive.
        public let description: String?
        /// The event pattern to use to filter events sent to the archive.
        public let eventPattern: String?
        /// The number of days to retain events in the archive.
        public let retentionDays: Int?

        public init(archiveName: String, description: String? = nil, eventPattern: String? = nil, retentionDays: Int? = nil) {
            self.archiveName = archiveName
            self.description = description
            self.eventPattern = eventPattern
            self.retentionDays = retentionDays
        }

        public func validate(name: String) throws {
            try self.validate(self.archiveName, name: "archiveName", parent: name, max: 48)
            try self.validate(self.archiveName, name: "archiveName", parent: name, min: 1)
            try self.validate(self.archiveName, name: "archiveName", parent: name, pattern: "[\\.\\-_A-Za-z0-9]+")
            try self.validate(self.description, name: "description", parent: name, max: 512)
            try self.validate(self.description, name: "description", parent: name, pattern: ".*")
            try self.validate(self.retentionDays, name: "retentionDays", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case archiveName = "ArchiveName"
            case description = "Description"
            case eventPattern = "EventPattern"
            case retentionDays = "RetentionDays"
        }
    }

    public struct UpdateArchiveResponse: AWSDecodableShape {
        /// The ARN of the archive.
        public let archiveArn: String?
        /// The time at which the archive was updated.
        public let creationTime: Date?
        /// The state of the archive.
        public let state: ArchiveState?
        /// The reason that the archive is in the current state.
        public let stateReason: String?

        public init(archiveArn: String? = nil, creationTime: Date? = nil, state: ArchiveState? = nil, stateReason: String? = nil) {
            self.archiveArn = archiveArn
            self.creationTime = creationTime
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case archiveArn = "ArchiveArn"
            case creationTime = "CreationTime"
            case state = "State"
            case stateReason = "StateReason"
        }
    }
}
